import { createStore } from 'vuex';



export default createStore({
  state: {
    // 拿取sessionStorage的user
    user: JSON.parse(window.sessionStorage.getItem('user')),
    
    i:0
       
    
  },
  mutations: {
    login (state, user) {
        console.log(555555555);
      state.user = user
      // 取出sessionStorage的user
      window.sessionStorage.setItem('user', JSON.stringify(user))
      
    }, 
    peoples(state,object){
     
      
      // state.peoples.unshift(object)
      // window.localStorage.setItem('peoples', state.peoples)
      // console.log(state.peoples[1]);
    }
  }
})